package com.ljr.request;

/**
 * @author ljr
 * @version 1.0
 * @description: TODO
 * @date 2021/12/20 21:30
 */
public class ApiRequest implements UrlClient{

    private String baseUrl;

    private String appId;

    private long timestamp;

    private String token;

    public ApiRequest(String baseUrl, String appId, long timestamp, String token) {
        this.baseUrl = baseUrl;
        this.appId = appId;
        this.timestamp = timestamp;
        this.token = token;
    }

    public static ApiRequest parseUrl(String url){
        String[] urls = url.split("&");
        return new ApiRequest(urls[0], urls[1], Long.valueOf(urls[2]), urls[3]);
    }

    @Override
    public String generateUrl() {
        return null;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public String getAppId() {
        return appId;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public String getToken() {
        return token;
    }
}
